package com.shire.shire_interface.service.phrase;

import com.shire.shire_interface.dao.phrase.WxPhraseReplyDao;
import com.shire.shire_interface.model.phrase.WxPhraseReply;
import com.shire.shire_interface.model.phrase.WxPhraseReplyExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class WxPhraseReplyService {
    @Resource
    private WxPhraseReplyDao phraseReplyDao;

    public int saveReplyPhrase(WxPhraseReply phraseReply){
        if (phraseReply.getId() == null){
            return phraseReplyDao.insertSelective(phraseReply);
        }else {
            return phraseReplyDao.updateByPrimaryKeySelective(phraseReply);
        }
    }

    public List<WxPhraseReply> selectByExample(WxPhraseReplyExample example){
        return phraseReplyDao.selectByExample(example);
    }

    public int deleteById(Integer id){
        return phraseReplyDao.deleteByPrimaryKey(id);
    }
}
